<?php

namespace App\Http\Controllers;

use App\Users;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class LayuiController extends Controller
{
    public function index() {
        return view('layui');
    }

    /**
     * @return \Illuminate\Http\JsonResponse
     *
     */
    public function getusers() {
        $data = [
            'code'=>0,
            'msg'=>'',
            'count'=>Users::all()->count(),
            'data'=>Users::orderBy('id')->get()
        ];
        return response()->json($data);
    }
}
